Add edge case tests for prompt validation (fixes #316)#362
Add edge case tests for prompt validation (fixes #316)#362Nedas-Jaronis wants to merge 2 commits intogoogle:mainfrom
Conversation
Add three new test cases to improve coverage of edge cases: - test_empty_extraction_text: Validates empty strings are rejected - test_unicode_and_special_chars: Ensures unicode handling (café, °F, €) - test_very_long_extraction_text: Tests graceful handling of 1000+ chars These tests improve reliability by catching edge case bugs early and documenting expected behavior for boundary conditions.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Replaces simpler edge case tests from google#317 with more thorough versions: - Empty extraction text: validates ValueError with message check - Unicode/special chars: tests euro, pound, yen, degree symbols with exact match assertion - Very long text: tests 1000+ char passages with alignment Upstream: google#362 (supersedes google#317)
Applied PRs: google#356, google#369, google#329, google#267, google#305, google#326, google#352, google#359, google#317, google#362, google#242, google#310, google#241. Moved from Low Priority to Applied section. Updated cherry-pick log with all commit hashes.
|
Your branch is 1 commits behind git fetch origin main
git merge origin/main
git pushNote: Enable "Allow edits by maintainers" to allow automatic updates. |
3 similar comments
|
Your branch is 1 commits behind git fetch origin main
git merge origin/main
git pushNote: Enable "Allow edits by maintainers" to allow automatic updates. |
|
Your branch is 1 commits behind git fetch origin main
git merge origin/main
git pushNote: Enable "Allow edits by maintainers" to allow automatic updates. |
|
Your branch is 1 commits behind git fetch origin main
git merge origin/main
git pushNote: Enable "Allow edits by maintainers" to allow automatic updates. |
|
Your branch is 7 commits behind git fetch origin main
git merge origin/main
git pushNote: Enable "Allow edits by maintainers" to allow automatic updates. |
|
Your branch is 8 commits behind git fetch origin main
git merge origin/main
git pushNote: Enable "Allow edits by maintainers" to allow automatic updates. |
|
Your branch is 11 commits behind git fetch origin main
git merge origin/main
git pushNote: Enable "Allow edits by maintainers" to allow automatic updates. |
Description
Fixes #316
This PR adds three new edge case tests to improve test coverage for the prompt validation module, addressing gaps in error handling and boundary condition testing.
Problem
The prompt validation test suite lacks coverage for important edge cases that could cause unexpected behavior in production:
Proposed Solution
Add three new test cases to
tests/prompt_validation_test.py:test_empty_extraction_text()- Verify that empty strings are properly rejected with ValueErrortest_unicode_and_special_chars()- Ensure proper handling of unicode characterstest_very_long_extraction_text()- Test graceful handling of very long extractionsBenefits
How Has This Been Tested?
All three tests pass successfully:
Result: 3 passed ✅
Full test suite:
Result: 395 passed, 77 warnings ✅
Testing environment:
Checklist